<%@page import="com.core.ui.controller.ActionBarController"%>
<%@page import="com.entities.usergroup.actionscript.ActionScriptParserGroupOpen"%>
<%@page import="com.entities.usergroup.list.UserGroupListController"%>
<%@page import="com.core.managers.SessionManager"%>
<%@page import="com.core.utils.GlobalConstants"%>

<%@taglib prefix="sorokina" uri="/WEB-INF/Sorokina.tld"%>
<script type="text/javascript">
	function deleteGroup(groupId) {
		var confirmResult = confirm("Are you sure to delete group?");
		if (confirmResult) {

			jQuery.post('
<%=GlobalConstants.SERVLET_GROUPDELETE%>
	', {
				'id' : groupId
			}, function(data) {
				location.reload();
			});

		}
	}
</script>

<%
	SessionManager.addContext(GlobalConstants.USERCONTEXT_GROUP);
	SessionManager.addContext(GlobalConstants.USERCONTEXT_GROUPSLIST);
	String groupId = request.getParameter(GlobalConstants.SERVLET_PARAM_KEY);

	UserGroupListController groupListController = new UserGroupListController();

	ActionScriptParserGroupOpen actionScriptParser = new ActionScriptParserGroupOpen();
	actionScriptParser.setGroupId(groupId);

	ActionBarController actionBarController = new ActionBarController();
	actionBarController.setActionScriptParser(actionScriptParser);
%>


<div>

    <sorokina:ActionBarView datasource="<%=actionBarController %>" />

    <sorokina:TableView datasource="<%=groupListController%>" delegate="<%=groupListController%>" />

</div>